let calculator = {
    x: 0,
    y: 0,
    read() {
       this.x = Number(prompt('Input x:'));
       this.y = Number(prompt('Input y:')); 
    },

    sum() {
        return this.x + this.y;
    },

    mul() {
        return this.x * this.y;
    }
};

calculator.read();
alert(calculator.sum());

alert(calculator.mul());